<%--
  Created by IntelliJ IDEA.
  User: zzf
  Date: 2021/1/7
  Time: 16:32
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="/public/header/permissionCommon.jspf" %>
<html>
<head>
    <title>护理人员信息管理</title>
    <c:set var="path" value="${pageContext.request.contextPath}" scope="page"/>
    <style type="text/css">
        .layui-table-tips-main{display:none}
        .layui-table-tips-c{display:none}
        .layui-table-grid-down {display: none;}
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部和左侧导航-->
    <div id="header"></div>
    <!--右侧主体区域-->
    <div class="layui-body" >
        <div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
            <ul class="layui-tab-title">
                <li class="layui-this">护理人员信息</li>
                <li>历史变更记录</li>
            </ul>
            <div class="layui-tab-content">
                <%----------- 护工信息页面 -----------%>
                <div id="NursingInfoDiv" class="layui-tab-item layui-show">
                    <%------- 搜索&文件上传功能 ------%>
                    <div class="SearchLoadNursing" style="font-size: small">
                        <%----------- 搜索功能 ---------%>
                        护理人员姓名：
                        <div class="layui-inline">
                            <input class="layui-input" name="name" id="name" autocomplete="off" style="height: 30px;width:100px;margin-right: 15px">
                        </div>
                        医保ID：
                        <div class="layui-inline">
                            <input class="layui-input" name="ybid" id="ybid" autocomplete="off" style="height: 30px;width:100px;margin-right: 15px">
                        </div>
                        申报单位：
                        <div class="layui-inline">
                            <input class="layui-input" name="sbdw" id="sbdw" autocomplete="off" style="height: 30px;width:100px;margin-right: 15px">
                        </div>
                        <br><br>
                        职业等级：
                        <div class="layui-inline layui-form" style="width: 150px;margin-right: 50px" >
                            <select name="zylevel" id="zylevel" lay-filter="zylevel"  class="select" style="margin-right: 50px">
                                <option value="">请选择职业等级</option>
                                <option value="一级">一级</option>
                                <option value="二级">二级</option>
                                <option value="三级">三级</option>
                                <option value="四级">四级</option>
                            </select>
                        </div>
                        人员状态：
                        <div class="layui-inline" id="status" name="status" lay-filter="status" style="width: 300px;margin-right: 15px"></div>

                        <div class="layui-inline">
                            <button class="searchBtn" data-type="reload1" style="margin-left:10px;height:30px;width:85px;background-color: #009688;color: white;border: none;border-radius: 5px">
                                <i class="layui-icon layui-icon-search"> </i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -6px;margin-left: 5px;margin-right: 5px">搜 索</div>
                            </button>
                        </div>
                        <%-------------文件导出-------------%>
                        <div class="layui-inline" style="float: right">
                            <button class="layui-btn layui-btn-sm" id="exportExcel" name="exportExcel" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px;margin-top: -35px;margin-right: 10px">
                                <i class="layui-icon layui-icon-export"></i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px">导出文件</div>
                            </button>
                        </div>
                        <%-------------文件导入-------------%>
                        <div class="layui-inline" style="float: right">
                            <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" id="uploadExcel" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px;margin-top:5px;font-size:small; margin-right: 10px">
                                <i class="layui-icon layui-icon-upload-drag"></i>
                                &nbsp上传文件
                            </button>
                        </div>
                            <%-------------新增-------------%>
                            <div class="layui-inline" style="float: right">
                                <button class="searchBtn layui-btn layui-btn-sm"  data-type="Add" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px;margin-top:5px;font-size:small; margin-right: 10px;background-color: #009688">
                                    <i class="layui-icon layui-icon-export"></i>
                                    <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px">新 增</div>
                                </button>
                            </div>
                    </div>
                    <%-----------护理人员表格显示----------%>
                    <table class="layui-hide" id="nursingInfoList" lay-filter="nursing"></table>
                </div>
                <%-----------历史变更信息-----------%>
                <div id="NursingInfoChangedDiv" class="layui-tab-item">
                    <%-----------搜索 & 文件导出 功能-----------%>
                    <div class="SearchLoadNursing" style="font-size: small">
                        <%------------搜索功能---------------%>
                        护工姓名：
                        <div class="layui-inline">
                            <input class="layui-input" name="nameSearch" id="nameSearch" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>
                        医保ID：
                        <div class="layui-inline">
                            <input class="layui-input" name="ybidSearch" id="ybidSearch" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>
                        变更字段名称：
                        <div class="layui-input-inline layui-form" style="width: 150px">
                            <input class="layui-input" name="titleSearch" id="titleSearch" autocomplete="off" style="height: 30px;width:100px;margin-right: 10px">
                        </div>

                        <div class="layui-inline">
                            <button class="searchBtn" data-type="reload2" style="margin-left:10px;height:30px;width:85px;background-color: #009688;color: white;border: none;border-radius: 5px">
                                <i class="layui-icon layui-icon-search"></i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -6px;margin-left: 5px;margin-right: 5px">搜 索</div>
                            </button>
                        </div>
                        <%-------------文件导出-------------%>
                        <div class="layui-inline" style="float: right">
                            <button class="layui-btn layui-btn-sm" id="exportChangedExcel" name="exportChangedExcel" style="width: 100px;float: right;border-radius: 5px;margin-left: 5px">
                                <i class="layui-icon layui-icon-export"></i>
                                <div class="layui-inline" style="font-size: small;text-align:center;margin-top: -3px">导出文件</div>
                            </button>
                        </div>
                    </div>
                    <%----------- 变更表格显示--------------%>
                    <table class="layui-hide" id="nursingInfoChangedList" lay-filter="nursingChanged" ></table>
                </div>
            </div>
        </div>
    </div>
    <!--底部-->
    <div id="footer"></div>
    <%--头部和底部--%>
    <%--<script src="${webPath}/js/permission/auth/permList.js"></script>--%>
    <script>
        $("#header").load("${webPath}/publicPages/permission/fragments/header.jsp");
        $("#footer").load("${webPath}/publicPages/permission/fragments/footer.jsp");
    </script>

    <!-- 护理人员信息表格 -->
    <script type="text/javascript" src="${webPath}/js/basicInfo/NurseStaff.js"></script>
    <%-------------编辑删除框--------------%>
    <%--查看页面的编辑框--%>
    <script type="text/html" id="Check_Edit_Del">
        <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
    </script>
    <%--历史变更页面的编辑框--%>
    <script type="text/html" id="Check">
        <a class="layui-btn layui-btn-xs" lay-event="detail" style="margin-top: 5px">查看</a>
    </script>
    <script type="text/javascript" src="${path}/lib/jquery-3.3.1.min.js"></script>

    <%--------------------- 信息页面查看功能 ---------------------%>
    <script type="text/javascript" src="${webPath}/js/utils.js"></script>
    <div class="nursingDetail" id="NursingDetail" style="display: none">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <div class="layui-col-xs6 ">
                    <label class="layui-form-label" >姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value={name} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">性别</label>
                    <div class="layui-input-block">
                        <input type="text" name="gender" value={gender} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item"><%--ok--%>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">身份证号</label>
                    <div class="layui-input-block">
                        <input type="text" name="id_number" value={id_number} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">手机号</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone_number" value={phone_number} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">医保ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="ybid" value={ybid} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">职业等级</label>
                    <div class="layui-input-block">
                        <input type="text" name="zylevel" value={zylevel} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item" >
                <div class="layui-col-xs6">
                    <label class="layui-form-label" >工作年限</label>
                    <div class="layui-input-block">
                        <input type="text" name="worklength" value={worklength} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6" >
                    <label class="layui-form-label" >人员状态</label>
                    <div class="layui-input-block">
                        <input class="layui-input" type="text" name="status" readonly="readonly" value={status}>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">人员类别</label>
                <div class="layui-input-block">
                    <input type="text" name="rylb" value={rylb} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">护理机构</label>
                <div class="layui-input-block">
                    <input type="text" name="serv_org" value={serv_org} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">上一家护理机构</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="data" name="lastserv_org" readonly="readonly" value={lastserv_org} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">申报单位</label>
                <div class="layui-input-block">
                    <input type="text" name="sbdw" value={sbdw} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >申报单位机构代码</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="sbdwcode" value={sbdwcode} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">发证日期</label>
                    <div class="layui-input-block">
                        <input type="date" name="fzrq" value={fzrq} class="layui-input" readonly="readonly">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">证书编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="certificate_code" value={certificate_code} class="layui-input" readonly="readonly">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >获得医保标识码日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="ybbsmrq" value={ybbsmrq} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >首次服务日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="datetime-local" step="1"  name="fservdate" value={fservdate} class="layui-input" readonly="readonly">
                </div>
            </div>
        </form>
    </div>
    <%---------------------信息页面修改护工信息--------------------%>
    <div class="editNursing" id="NursingEdit" style="display: none;">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <div class="layui-col-xs6 ">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value={name} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>性别</label>
                    <div class="layui-input-block">
                        <input type="text" name="gender" value={gender} lay-verify="required" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>身份证号</label>
                    <div class="layui-input-block">
                        <input type="text" name="id_number" value={id_number} lay-verify="required|identity" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>手机号</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone_number" value={phone_number} lay-verify="required|phone" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>医保ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="ybid" value={ybid} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>职业等级</label>
                    <div class="layui-input-block">
                        <select name="zylevel">
                            <option value="一级" {select1}>一级</option>
                            <option value="二级" {select2}>二级</option>
                            <option value="三级" {select3}>三级</option>
                            <option value="四级" {select4}>四级</option>
                        </select>
                        <%--<input type="text" name="zylevel" value={zylevel} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" >
                <div class="layui-col-xs6">
                    <label class="layui-form-label">工作年限</label>
                    <div class="layui-input-block">
                        <input type="text" name="worklength" value={worklength} class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6" >
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>人员状态</label>
                    <div class="layui-input-block">
                        <select name="status">
                            <option value="有效待岗" {select5}>有效待岗</option>
                            <option value="有效在岗" {select6}>有效在岗</option>
                            <option value="无效转出" {select7}>无效转出</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>人员类别</label>
                <div class="layui-input-block">
                    <input type="text" name="rylb" value={rylb} lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>护理机构</label>
                <div class="layui-input-block">
                    <input type="text" name="serv_org" value={serv_org} lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">上一家护理机构</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="lastserv_org" value={lastserv_org} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>申报单位</label>
                <div class="layui-input-block">
                    <input type="text" name="sbdw" value={sbdw} lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">申报单位机构代码</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="sbdwcode" value={sbdwcode} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">启变日期</label>
                    <div class="layui-input-block">
                        <input type="date" name="start_change_date" value={start_change_date} class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">发证日期</label>
                    <div class="layui-input-block">
                        <input type="date" name="fzrq" value={fzrq} class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">证书编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="certificate_code" value={certificate_code} class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >获得医保标识码日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="ybbsmrq" value={ybbsmrq} class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >首次服务日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="datetime-local"step="1" name="fservdate" value={fservdate} class="layui-input" step="1">
                </div>
            </div>
            <div class="layui-form-item" style="display: none">
                <label class="layui-form-label">序号</label>
                <div class="layui-input-block">
                    <input type="text" name="id" value={id} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item" align="center" style="margin-top: 20px;margin-bottom: 20px">
                <button type="submit" class="layui-btn" lay-submit="" id="handin" lay-filter="handin" style="margin-right: 20px">
                    <div style="font-weight: bold;font-size: medium">立 即 提 交</div>
                </button>
                <button class="layui-btn layui-btn-primary" style="width:100px" type="button">
                    <div style="font-weight: bold;font-size: medium" onclick="javascript:history.go(-1)">取&nbsp&nbsp&nbsp&nbsp消</div>
                </button>
            </div>
        </form>
    </div>
    <%---------------------信息页面新增护工信息--------------------%>
    <div class="editNursing" id="NursingAdd" style="display: none;">
        <form  class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <div class="layui-col-xs6 ">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>姓名</label>
                    <div class="layui-input-block">
                        <input type="text" name="name" value={name} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>性别</label>
                    <div class="layui-input-block">
                        <select name="gender">
                            <option value="" >性别</option>
                            <option value="男" >男</option>
                            <option value="女" >女</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>身份证号</label>
                    <div class="layui-input-block">
                        <input type="text" name="id_number" value={id_number} lay-verify="required|identity" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>手机号</label>
                    <div class="layui-input-block">
                        <input type="text" name="phone_number" value={phone_number} lay-verify="required|phone" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>医保ID</label>
                    <div class="layui-input-block">
                        <input type="text" name="ybid" value={ybid} lay-verify="required" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>职业等级</label>
                    <div class="layui-input-block">
                        <select name="zylevel">
                            <option value="" >请输入护工级别</option>
                            <option value="一级" >一级</option>
                            <option value="二级">二级</option>
                            <option value="三级">三级</option>
                            <option value="四级">四级</option>
                        </select>
                        <%--<input type="text" name="zylevel" value={zylevel} lay-verify="required" class="layui-input">--%>
                    </div>
                </div>
            </div>
            <div class="layui-form-item" >
                <div class="layui-col-xs6">
                    <label class="layui-form-label">工作年限</label>
                    <div class="layui-input-block">
                        <input type="text" name="worklength" value={worklength} class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6" >
                    <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>人员状态</label>
                    <div class="layui-input-block">
                        <select name="status">
                            <option value="" >请输入人员状态</option>
                            <option value="有效待岗" >有效待岗</option>
                            <option value="有效在岗" >有效在岗</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>人员类别</label>
                <div class="layui-input-block">
                    <input type="text" name="rylb" value={rylb} lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>护理机构</label>
                <div class="layui-input-block">
                    <input type="text" name="serv_org" value={serv_org} lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">上一家护理机构</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="lastserv_org" value={lastserv_org} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label"><div class="layui-inline"style="color: red">*</div>申报单位</label>
                <div class="layui-input-block">
                    <input type="text" name="sbdw" value={sbdw} lay-verify="required" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;">申报单位机构代码</label>
                <div class="layui-input-block">
                    <input style="height: 55px" type="text" name="sbdwcode" value={sbdwcode} class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-col-xs6">
                    <label class="layui-form-label">发证日期</label>
                    <div class="layui-input-block">
                        <input type="date" name="fzrq" value={fzrq} class="layui-input">
                    </div>
                </div>
                <div class="layui-col-xs6">
                    <label class="layui-form-label">证书编号</label>
                    <div class="layui-input-block">
                        <input type="text" name="certificate_code" value={certificate_code} class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >获得医保标识码日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="date" name="ybbsmrq" value={ybbsmrq} class="layui-input" >
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >首次服务日期</label>
                <div class="layui-input-block">
                    <input style="height: 55px;" type="datetime-local"step="1" name="fservdate" value={fservdate} class="layui-input" step="1">
                </div>
            </div>
            <div class="layui-form-item" style="display: none">
                <label class="layui-form-label">序号</label>
                <div class="layui-input-block">
                    <input type="text" name="id" value={id} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item" align="center" style="margin-top: 20px;margin-bottom: 20px">
                <button type="submit" class="layui-btn" lay-submit="" id="add" lay-filter="handAdd" style="margin-right: 20px">
                    <div style="font-weight: bold;font-size: medium">立 即 提 交</div>
                </button>
                <button class="layui-btn layui-btn-primary" style="width:100px" type="button">
                    <div style="font-weight: bold;font-size: medium" onclick="javascript:history.go(-1)">取&nbsp&nbsp&nbsp&nbsp消</div>
                </button>
            </div>
        </form>
    </div>
    <script>
        layui.use('form', function(){
            var form = layui.form
            form.on('submit(handin)', function(data){
                console.log("开始提交");
                console.log(data.field)
                $.ajax({
                    url:'/staff/updateStaff',
                    method:'POST',
                    data:data.field,
                    dataType:'JSON',
                    success:function(res){
                        console.log(res.msg);
                        if(res.msg=="ok"){
                            console.log("成功提交"+data.field);
                            layer.msg("提交成功",{icon: 1, time: 1500},function(){location.reload();}); //提交成功后刷新页面
                        }else{
                            console.log("请确保“医保ID”输入正确"+data.field);
                            layer.msg("请确保“医保ID”输入正确",{icon:5,anim:6,offset: "auto"})
                        }
                    },
                    error:function (data) {
                        console.log("提交失败",data);
                        console.log("表单提交错误")
                    }
                });
                return false;
            })
        })
    </script>
    <%---------------------- 护工新增页面查看功能 -------------------%>
    <script>
        layui.use('form', function(){
            var form = layui.form
            form.on('submit(handAdd)', function(data){
                console.log("开始提交");
                console.log(data.field)
                $.ajax({
                    url:'/staff/AddStaff',
                    method:'POST',
                    data:data.field,
                    dataType:'JSON',
                    success:function(res){
                        console.log(res.msg);
                        if(res.msg=="ok"){
                            console.log("成功提交"+data.field);
                            layer.msg("提交成功",{icon: 1, time: 1500},function(){location.reload();}); //提交成功后刷新页面
                        } else{
                            console.log("该护工有效待岗或有效在岗，请仔细检查"+data.field);
                            layer.msg("该护工有效待岗或有效在岗，请仔细检查",{icon:5,anim:6,offset: "auto"})
                        }
                    },
                    error:function (data) {
                        console.log("提交失败",data);
                        console.log("表单提交错误")
                    }
                });
                return false;
            })
        })
    </script>
    <%---------------------- 历史变更页面查看功能 -------------------%>
    <div class="nursingDetail" id="NursingChangedDetail" style="display: none">
        <form class="layui-form layui-form-pane" style="margin-top: 20px;margin-left: 10px;margin-right: 10px;">
            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" value={name} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">医保ID</label>
                <div class="layui-input-block">
                    <input type="text" name="ybid" value={ybid} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">启变日期</label>
                <div class="layui-input-block">
                    <input type="date" step="1"  name="start_change_date" value={start_change_date} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">变更时间</label>
                <div class="layui-input-block">
                    <input type="datetime-local" step="1"  name="history_change_time" value={history_change_time} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >变更字段名称</label>
                <div class="layui-input-block">
                    <input type="text" style="height: 55px" name="changed_title" value={changed_title} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >变更前的内容</label>
                <div class="layui-input-block">
                    <input type="text" style="height: 55px"  name="history_content" value={history_content} class="layui-input" readonly="readonly">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label" style="height: 55px;white-space:pre-line!important;" >变更后的内容</label>
                <div class="layui-input-block">
                    <input type="text" style="height: 55px"  name="new_content" value={new_content} class="layui-input" readonly="readonly">
                </div>
            </div>
        </form>
    </div>
    <%------------------- EXCEL 文件上传------------------%>
    <script type="text/javascript">
        layui.use('upload', function(){
            var $ = layui.jquery
                ,upload = layui.upload;
            upload.render({
                elem: '#uploadExcel'
                ,url: '/staff/InputExcel' //改成您自己的上传接口
                ,accept: 'file' //普通文件
                ,exts: 'xls|xlsx' //只允许上传压缩文件
                ,done: function(res){
                    console.log(res);
                    if(res.msg=="ok"){
                        layer.msg("文件导入成功",{icon: 1, time: 1500},function(){location.reload();});
                        // alert("文件导入成功");
                    }else{
                        layer.msg("文件导入失败",{icon: 2, time: 1500},function(){location.reload();});
                        // alert("文件导入失败失败");
                    }
                }
            });
        })
    </script>
    <%------------------- 变更页面 EXCEL 文件导出------------------%>
    <script type="text/javascript">
        layui.config({//配置并导入excel插件
            base: '${base}/js/layui_exts/'
        }).use([ 'excel', 'layer'], function() {
            var $ = layui.$;
            var layer = layui.layer;
            var excel = layui.excel;
            $('#exportChangedExcel').on('click', function(){
                console.log("触发导出按钮");
                var send_name = $('#nameSearch');
                var send_code = $('#ybidSearch');
                var send_title=$('#titleSearch');
                console.log("导出：搜索的机构是"+send_name.val());
                console.log("导出：搜索的结算代码是"+send_code.val());
                console.log("导出：搜索的名称是"+send_title.val());
                layer.confirm('是否确认导出', function(index) {
                    $.ajax({
                        url: '/staff/ExportAllChangedInfo'
                        ,method:'post'
                        ,data: {
                            nameSearch: send_name.val(),
                            ybidSearch: send_code.val(),
                            titleSearch:send_title.val()
                        }
                        , dataType: 'json'
                        , success(res) {
                            var data = res;
                            console.log(res);
                            layer.close(index);
                            data = excel.filterExportData(data, [
                                'name'
                                , 'ybid'
                                , 'history_change_time'
                                , 'changed_title'
                                , 'history_content'
                                , 'new_content'
                            ]);
                            data.unshift({
                                name: "护工姓名", ybid: "医保ID",
                                history_change_time: "修改时间",changed_title:"变更字段名称",
                                history_content:"变更前内容",new_content:"变更后内容"
                            });
                            excel.exportExcel(data, '服务机构变更信息导出--' + new Date().toLocaleString() + '.xlsx', 'xlsx');
                        }
                        , error() {
                            layer.alert('获取数据失败，请检查是否部署在本地服务器环境下');
                        }
                    });
                });
            });
        });
    </script>
</div>
</body>
</html>
